//
//  CollectionHeaderView.m
//  SeplitDemo
//
//  Created by 信恩世通 on 2017/8/1.
//  Copyright © 2017年 Xiyuekeji. All rights reserved.
//

#import "CollectionHeaderView.h"

@interface CollectionHeaderView ()

@property (weak, nonatomic) UILabel *titleLab;

@end

@implementation CollectionHeaderView

#pragma mark - **** instance ****

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        UILabel *titleLab = [UILabel infoLabel];
        titleLab.font = Font(17);
        titleLab.textColor = COLOR_BLACK;
        
        [self addSubview:titleLab];
        self.titleLab = titleLab;
        
        [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self);
            make.left.mas_equalTo(self).offset(2 * SPACE);
        }];
        
        self.backgroundColor = COLOR_VIEW_BACKGROUND;
    }
    
    return self;
}


#pragma mark - **** setter & getter ****

- (void)setTitleStr:(NSString *)titleStr {
    _titleStr = titleStr;
    
    self.titleLab.text = titleStr;
}

@end
